<?php

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name' => 'Eduow',
	'defaultController'=>'site',
	'language'=>'bg',
	
	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.components.helpers.*',
		'application.components.behaviors.*',
		'application.components.widgets.*',
		'application.extensions.*',
	),
	'preload'=>array('log'),
	'modules'=>array(
		'textedit',
		'email' => array(
			'delivery'=>'debug',
		),
	),
	// application components
	'components'=>array(
		'session' => array(
			'class' => 'system.web.CDbHttpSession',
			'connectionID' => 'db',
		),
        'errorHandler'=>array(
            'errorAction'=>'site/error',
        ),
		'db'=>require(dirname(__FILE__).'/db.php'),
		'user'=>array(
			'class'=>'application.components.WebUser',
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
			'loginUrl'=>array('user/login'),
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				'file'=>array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning, watch',
					'categories'=>'system.*',
				),
				array(
					'class'=>'CDbLogRoute',
					'connectionID'=>'db',
                    'levels'=>'error, warning, info, application',
					'categories'=>'application.*',
				),
			),
		),
		'request'=>array(
    			//'enableCsrfValidation'=>true,
			'enableCookieValidation'=>true,
		),
        	'jformvalidate' => array (
                	'class' => 'application.extensions.jformvalidate.EJFValidate',
                	'enable' => true
        	),
        	'tinymce' => array (
                	'class' => 'application.extensions.TinyMCE',
                	'enable' => true
        	),
		'urlManager'=>array(
			'urlFormat'=>'path',
			'showScriptName' => false,
			//'caseSensitive'=>false,
			'rules'=>array(
        			'post/<id:\d+>/<title:.*?>'=>'post/view',
        			'posts/<tag:.*?>'=>'post/index',
				'/home'=>'/site/index',
				'eduow'=>'/site/eduow',
				'rss'=>'/site/rss',
				'team'=>'/site/team',
				'about'=>'/site/about',
				'user/register/*'=>'user/create',
				'user/settings/*'=>'user/update',
			),
		),
		'CLinkPager' => array(
			'class'=>'CLinkPager',
			'cssFile'=>false,
		),
		'coreMessages'=>array(
                	'basePath'=>'protected/messages',
        	),
	),
	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'admin@eduow.com',
		'supportEmail'=>'support@eduow.com',
	),
);
